<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/head::head('编辑角色 - 广告机管理后台')"></head>
<!--/* <editor-fold desc="define"> */-->
<!--/*@thymesVar id="adminPath" type="java.lang.String"*/-->
<!--/*@thymesVar id="adminRoleID" type="java.lang.Integer"*/-->
<!--/*@thymesVar id="newEntityID" type="java.lang.Integer"*/-->
<!--/*@thymesVar id="loginUser" type="com.xmlan.machine.module.user.entity.User"*/-->
<!--/*@thymesVar id="role" type="com.xmlan.machine.module.role.entity.Role"*/-->
<!--/*@thymesVar id="token" type="java.lang.String"*/-->
<!--/* </editor-fold> */-->

<body>
<th:block th:include="/common/header::header('role')"/>

<main style="z-index: 0;">
  <div class="page-title z-depth-1 blue-grey darken-2">
    <div class="white-text">
      <span class="flow-text">
        <a class="btn-flat tooltipped" data-position="bottom" data-delay="50" data-tooltip="返回列表"
           onclick="history.go(-1);"><i class="material-icons white-text">arrow_back</i></a><span
          th:text="${role.id==newEntityID?'新增角色':role.name}"></span>
      </span>
    </div>
  </div>
  <br/>
  <div id="main-content" class="container">
    <form th:action="@{${adminPath}+'/role/save/'+${role.id}}" method="post">
      <input id="id" name="id" type="hidden" th:value="${role.id}" class="validate" required="required"/>
      <input name="token" th:value="${token}" type="hidden"/>
      <div class="row">
        <div class="input-field col s6 m3 l3">
          <i class="material-icons prefix">assignment_ind</i>
          <input id="name" name="name" type="text" th:value="${role.name}" class="validate" placeholder="输入角色名"
                 required="required"/>
          <label for="name">角色名</label>
        </div>
        <div class="input-field col s12 m12 l12">
          <i class="material-icons prefix">insert_comment</i>
          <textarea id="remark" name="remark" th:text="${role.remark}" class="materialize-textarea"></textarea>
          <label for="remark">备注</label>
        </div>
      </div>
      <div class="row">
        <div class="input-field col s6 m6 l6 right-align">
          <button type="reset" class="waves-effect waves-light btn">
            <i class="material-icons left">clear</i>清空
          </button>
        </div>
        <div class="input-field col s6 m6 l6 left-align">
          <button type="submit" class="waves-effect waves-light btn">
            <i class="material-icons right">send</i>提交
          </button>
        </div>
      </div>
    </form>
  </div>
</main>

<th:block th:include="/common/footer::footer"/>
<th:block th:include="/common/script::script"/>
<script type="text/javascript">
  $(function () {
    resize_footer(window.screen.width);
    $("#button-nav-menu").sideNav({
      closeOnClick: true,
      draggable: true
    });
    $(".dropdown-button").dropdown();
    $(".date-picker").pickadatee({
      closeOnSelect: true
    });
    toast('[[${message}]]');
  });
</script>
</body>
</html>
